import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import { getAssetsFile } from "@/utils/pub-use"
export const routes: Array<RouteRecordRaw> = [
    {
        path: "/:pathMath(.*)",
        redirect: "/index"
    },
    {
        path: "/",
        component: () => import('@/layout/index.vue'),
        redirect: '/index',
        children: [
            {
                path: '/index',
                name: 'index',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: "menu.index",
                    active: getAssetsFile('home-active.png'),
                    inactive: getAssetsFile('home.png'),
                }
            }, {
                path: '/privatePlacement',
                name: 'privatePlacement',
                component: () => import('@/views/privatePlacement/index.vue'),
                meta: {
                    title: "menu.privatePlacement",
                    active: getAssetsFile('privatePlacement-active.png'),
                    inactive: getAssetsFile('privatePlacement.png'),
                }
            }, {
                path: '/pledge',
                name: 'pledge',
                component: () => import('@/views/pledge/index.vue'),
                meta: {
                    title: "menu.pledge",
                    active: getAssetsFile('pledge-active.png'),
                    inactive: getAssetsFile('pledge.png'),
                }
            }, {
                path: '/swap',
                name: 'swap',
                component: () => import('@/views/swap/index.vue'),
                meta: {
                    title: "menu.swap",
                    active: getAssetsFile('swap-active.png'),
                    inactive: getAssetsFile('swap.png'),
                }
            }, {
                path: '/user',
                name: 'user',
                component: () => import('@/views/user/index.vue'),
                meta: {
                    title: "menu.user",
                    active: getAssetsFile('user-active.png'),
                    inactive: getAssetsFile('user.png'),
                }
            },
        ]
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
